/**
 * 全局 loading
 */

import { LoadingTemp } from "../Template/LoadingTemp";

export class Loading {
  public show(text?: string) {
    const loading = document.createElement("div");
    loading.className = "konva-root-loading";
    loading.innerHTML = LoadingTemp(text);
    document.body.appendChild(loading);
  }

  public hide() {
    const loading = document.querySelector(".konva-root-loading");
    loading?.remove();
  }
}
